<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE">
	<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
	<title>东易买，欢迎登录</title>

	<link rel="stylesheet" type="text/css" href="css/webbase.css" th:href="@{/css/webbase.css}"/>
	<link rel="stylesheet" type="text/css" href="css/pages-login.css" th:href="@{/css/pages-login.css}"/>
</head>

<body>
<div class="login-box" id="app">
	<!--head-->
	<div class="py-container logoArea">
		<a href="" class="logo"></a>
	</div>
	<!--loginArea-->
	<div class="loginArea">
		<div class="py-container login">
			<div class="loginform">
				<ul class="sui-nav nav-tabs tab-wraped">
					<li>
						<a href="#index" data-toggle="tab">
							<h3>扫描登录</h3>
						</a>
					</li>
					<li class="active">
						<a href="#profile" data-toggle="tab">
							<h3>账户登录</h3>
						</a>
					</li>
				</ul>
				<div class="tab-content tab-wraped">
					<div id="index" class="tab-pane">
						<p>二维码登录，暂为官网二维码</p>
						<img src="img/xg/erweima.png"/>
					</div>
					<div id="profile" class="tab-pane  active">
						<div class="sui-form">
							<div class="input-prepend"><span class="add-on loginname"></span>
								<input id="prependedInput" v-model="username" type="text" placeholder="邮箱/用户名/手机号"
									   class="span2 input-xfat">
							</div>
							<div class="input-prepend"><span class="add-on loginpwd"></span>
								<input id="prependedInput" v-model="password" type="password" placeholder="请输入密码"
									   class="span2 input-xfat">
							</div>
							<div class="setting">
								<label class="checkbox inline">
									<input name="m1" type="checkbox" value="2" checked="">
									自动登录
								</label>
								<span class="forget">忘记密码？</span>
							</div>
							<div class="logined">
								<button class="sui-btn btn-block btn-xlarge btn-danger" @click="login()">
									登&nbsp;&nbsp;录
								</button>
							</div>
						</div>
						<div class="otherlogin">
							<div class="types">
								<ul>
									<li><img src="img/qq.png" width="35px" height="35px" th:src="@{/img/qq.png}"/></li>
									<li><img src="img/sina.png" th:src="@{/img/sina.png}"/></li>
									<li><img src="img/ali.png" th:src="@{/img/ali.png}"/></li>
									<li><img src="img/weixin.png" th:src="@{/img/weixin.png}"/></li>
								</ul>
							</div>
							<span class="register"><a href="register.html" target="_blank">立即注册</a></span>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<!--foot-->
	<div class="py-container copyright">
		<ul>
			<li>关于我们</li>
			<li>联系我们</li>
			<li>联系客服</li>
			<li>商家入驻</li>
			<li>营销中心</li>
			<li>手机东易买</li>
			<li>销售联盟</li>
			<li>东易买社区</li>
		</ul>
		<div class="address">地址：北京市朝阳区五方桥基地 邮编：100096 电话：400-650-7353 传真：010-88888100</div>
		<div class="beian">京ICP备10218183号-88 京公网安备11010802020723号
		</div>
	</div>
</div>

<script type="text/javascript" src="js/plugins/jquery/jquery.min.js"
		th:src="@{/js/plugins/jquery/jquery.min.js}"></script>
<script type="text/javascript" src="js/plugins/jquery.easing/jquery.easing.min.js"
		th:src="@{/js/plugins/jquery.easing/jquery.easing.min.js}"></script>
<script type="text/javascript" src="js/plugins/sui/sui.min.js" th:src="@{/js/plugins/sui/sui.min.js}"></script>
<script type="text/javascript" src="js/plugins/jquery-placeholder/jquery.placeholder.min.js"
		th:src="@{/js/plugins/jquery-placeholder/jquery.placeholder.min.js}"></script>
<script type="text/javascript" src="js/pages/login.js" th:src="@{/js/pages/login.js}"></script>
<script src="/js/vue.js" th:src="@{/js/vue.js}"></script>
<script src="/js/axios.js" th:src="@{/js/axios.js}"></script>
<script th:inline="javascript">
	var app = new Vue({
		el: "#app",
		data: {
			username: '',
			password: '',
			from: [[${FROM}]]
		},
		methods: {
			login: function () {
				axios.post('/user/login?username=' + this.username + '&password=' + this.password).then(
						function (response) {
							if (response.data.flag) {//登录成功
								alert("登录成功");
								location.href=[[${FROM}]];
							} else {
								response.data.message;
							}
						}
				)
			}
		}
	})
</script>
</body>

</html>